﻿using System;
using System.Text;

namespace Domain.Engine.Tests
{
  public class Board
  {
    public Board()
    {
      Cells = new Cell[8,8];
      for (int row = 0; row < 8; row++)
      {
        for (int col = 0; col < 8; col++)
        {
          Cells[row, col] = new Cell();
        }
      }
    }

    public Cell[,] Cells { get; set; }

    public void Print()
    {
      Console.WriteLine(ToString());
    }

    public override string ToString()
    {
      var sb = new StringBuilder();
      for (int row = 0; row < 8; row++)
      {
        sb.Append(string.Format("{0} ", 8 - row));
        for (int col = 0; col < 8; col++)
        {
          sb.Append(Cells[row, col]);
          sb.Append(" ");
        }
        sb.Append("\n");
      }
      sb.Append("   A  B  C  D  E  F  G  H\n\n");
      return sb.ToString();
    }
  }
}